package com.hzh.blog.vo;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * 树结构数据的数据传输对象
 * 
 * @author chenxu
 * 
 */
public class TreeData {
	private String parentId;
	private String id;
	private String text;
	private boolean isexpand;
	private boolean ischecked;
	
	
	//节点级数
	private Integer lv;
	
	//子节点集合
	private List<TreeData> children;
	
	//数据来源(表名或XML或其他)
	private String dataSource;

	public boolean isIsexpand() {
		return isexpand;
	}

	public void setIsexpand(boolean isexpand) {
		this.isexpand = isexpand;
	}

	public List<TreeData> getChildren() {
		return children;
	}

	public void setChildren(List<TreeData> children) {
		this.children = children;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public static TreeData toTreeData(Object obj) {
		return (TreeData) obj;
	}

	public static List<TreeData> toTreeDataList(Object obj) {
		List list = (List) obj;
		List<TreeData> treeDataList = new ArrayList<TreeData>(list.size());
		for (Iterator iterator = list.iterator(); iterator.hasNext();) {
			Object object = (Object) iterator.next();
			treeDataList.add((TreeData) object);
		}
		return treeDataList;
	}

	public String getParentId() {
		return parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public Integer getLv() {
		return lv;
	}

	public void setLv(Integer lv) {
		this.lv = lv;
	}

	public String getDataSource() {
		return dataSource;
	}

	public void setDataSource(String dataSource) {
		this.dataSource = dataSource;
	}

	public boolean isIschecked() {
		return ischecked;
	}

	public void setIschecked(boolean ischecked) {
		this.ischecked = ischecked;
	}
}
